package com.huawei.classroom.student.h05;

public class Barrack extends Building{
	public Barrack() {
		 health=100;
		 force=0;
	 }
	 public Role traing(EnumObjectType type) {
		 if(type==EnumObjectType.rifleSoldier)
			 return new RifleSoldier();
		 if(type==EnumObjectType.RPGSoldier)
			 return new RPGSoldier();
		 if(type==EnumObjectType.dog)
			 return new Dog();
		 else {
			 System.out.println("Error, only rifleSoldier/RPGSoldier/dog");
			 return null;
		 }
	 }
}
